
from flask import send_from_directory, current_app

from . import api_blue


# 让前端能够来申请html文件的一个接口
@api_blue.route('/<re(r".*"):html_file_name>')
def index(html_file_name):
    if not html_file_name:
        html_file_name = "index.html"
    if html_file_name != "favicon.ico":
        html_file_name = "html/"+html_file_name
    return current_app.send_static_file(html_file_name)


# 首页
@api_blue.route('/')
def index():
    return current_app.send_static_file('html/index.html')
